//
//  caiWuRiZhiDetailViewController.m
//  shopping
//
//  Created by 马田成 on 2017/9/23.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "caiWuRiZhiDetailViewController.h"

@interface caiWuRiZhiDetailViewController ()
@property (weak, nonatomic) IBOutlet UILabel *number;
@property (weak, nonatomic) IBOutlet UILabel *currency;
@property (weak, nonatomic) IBOutlet UILabel *money;
@property (weak, nonatomic) IBOutlet UILabel *type;
@property (weak, nonatomic) IBOutlet UILabel *finance_type;
@property (weak, nonatomic) IBOutlet UILabel *add_time;
@property (nonatomic, strong) NSMutableDictionary *dataDic;
@end

@implementation caiWuRiZhiDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self creationData];
    [self setTitle:@"获取日志详情"];
    
    
    // Do any additional setup after loading the view from its nib.
}
- (void)creationData{
    
    _dataDic = [[NSMutableDictionary alloc] init];
    
    NSMutableDictionary *productParams=[[NSMutableDictionary alloc]init];
    NSString *token = [PublicFunction getConfigWithKey:@"token"];
    // NSString *token = @"32728a411b83e29b9836262a72477e3e0dac";
    
    [productParams setValue:token forKey:@"token"];
    [productParams setValue:self.datailID forKey:@"id"];
    
    
    [[MNetworkHandler sharedInstance]conURL:adminFinanceGetFinanceDetails networkType:NetWorkPOST params:productParams delegate:nil showHUD:NO successBlock:^(id returnData) {
        
        if ([[returnData objectForKey:@"code"]intValue]==1) {
            
            self.dataDic = [returnData objectForKey:@"data"];
            self.money.text = [self.dataDic objectForKey:@"money"];
            self.add_time.text = [self.dataDic objectForKey:@"add_time"];
            self.finance_type.text = [self.dataDic objectForKey:@"finance_type"];
            self.currency.text = [self.dataDic objectForKey:@"currency"];
            self.number.text = [self.dataDic objectForKey:@"number"];
            if ([[self.dataDic objectForKey:@"type"] isEqualToString:@"1"]) {
                
                self.type.text = @"收入:";
            }else {
            
                self.type.text = @"支出:";
                
            }
            
            
            
        }
        
        else {
            
            [PublicFunction showAlert:nil message:[returnData objectForKey:@"msg"] duration:5.0f];
            
        }
        
    } failureBlock:^(NSError *error) {
        
        NSLog(@"%@",error);
        
//        [PublicFunction showAlert:nil message:@"没有连接网络" duration:10.0f];
        
    }];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
